#include "stack.h"
#include <iostream>
#include<stdlib.h>
#include<windows.h>
using namespace std;
Stack::Stack(int num)
{
    _num=num;
    stack=new char[num];
    Init();
}
void Stack::Push(char c)
{
    if(!IsFull())
    {
        *(stack+Top++)=c;
        cout<<*(stack+Top-1)<<endl;
    }

}

void Stack::Pop()
{
    if(!IsEmpty ())
    {
        --Top;
        cout<<*(stack+Top)<<endl;
    }

}

bool Stack::IsEmpty()
{
    return Top==0;
}

bool Stack::IsFull()
{
    return Top==_num;
}

void Stack::Init()
{
    memset (stack,0,sizeof(Stack));
    Top=0;
}

